package com.nondo.dean.auth.provider;


import com.nondo.dean.auth.common.bean.AuthorityItem;
import com.nondo.dean.auth.domain.Authority;
import com.nondo.dean.common.web.Page;
import com.nondo.dean.common.web.Query;
import com.nondo.dean.common.web.View;

/**
 * @author slacrey
 * @since 2018/1/18
 */
public interface AuthorityManager {

    /**
     * 注册权限
     *
     * @param authority 权限项
     * @return {"code":20000,"message":""}
     */
    View<String> registerAuthority(AuthorityItem authority);

    /**
     * 注册权限
     *
     * @param authorityId 权限项
     * @return {"code":20000,"message":""}
     */
    View<String> deleteAuthority(Long authorityId);

    /**
     * 分页查询权限列表
     *
     * @param query 查询对象
     * @return 分页
     */
    View<Page<Authority>> findPageAuthority(Query<AuthorityItem> query);

    /**
     * 分页查询权限
     *
     * @param authorityId 权限ID
     * @return
     */
    View<Authority> findAuthorityById(Long authorityId);
}
